<template>
    <el-container>
        <el-aside width="1000px">
            <el-form ref="dialogForm" label-width="100px">
                <el-row>
                    <el-form-item label-width="120px" label="方法列表">
                        <el-select placeholder="---请选择请求的方法---" v-model="requestIndex" style="width: 300px" @change="optionChange">
                            <el-option v-for="item, i in optionsInfo" :key="item.index" :label="`${i + 1}.${item.indexText}`" :value="item.index" />
                        </el-select>
                        <el-icon v-if="hasToken" :size="20">
                            <key />
                        </el-icon>
                        <span v-if="!hasToken" style="color: red">尚未登录,请登录</span>
                        <button @click="dialogVisble = true" v-if="hasToken">查看token</button>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label-width="120px" label="参数说明">
                        <el-input v-model="requestRemark" placeholder="参数说明" style="width: 850px" rows="5" type="textarea" />
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label-width="120px" label="请求参数">
                        <el-input v-model="requestContent" placeholder="请求参数" style="width: 850px" rows="10" type="textarea" />
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label-width="120px" label>
                        <el-button @click="submit">提交</el-button>
                        <el-button @click="format">格式化请求参数</el-button>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label-width="120px" label="执行结果">
                        <el-input v-model="requestResult" placeholder="执行结果" style="width: 850px" rows="10" type="textarea" />
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label-width="120px" label="参数说明">
                        <el-input v-model="responeContent" placeholder="参数说明" style="width: 850px" rows="5" type="textarea" />
                    </el-form-item>
                </el-row>
            </el-form>
        </el-aside>
        <el-main>
            <json-viewer :value="responseResult" :indent="2" :expanded="expanded" :expand-depth="5" boxed sort copyable></json-viewer>
        </el-main>
    </el-container>

    <el-dialog title="token" v-model="dialogVisble" width="30%" :before-close="close">
        <span>{{ token }}</span>
        <template #footer>
            <span class="dialog-footer">
                <el-button @click="dialogVisble = false">关闭</el-button>
            </span>
        </template>
    </el-dialog>
</template>
<script>
import publicjs from "@/api/model/publicjs";
import config from "@/config";
import http from "@/utils/request";
import JsonViewer from 'vue-json-viewer'
export default {
    name: "memberService",
    emits: ["success", "closed"],
    components: {
        publicjs,
        JsonViewer
    },
    data() {
        return {
            //表单数据
            dialogVisble: false,
            token: "",
            hasToken: false,
            requestIndex: "AppMemberLogin",
            requestRemark: "",
            requestContent: "",
            requestResult: "",
            responseResult: "",
            responeContent: "",
            optionsInfo: [
                {
                    index: "AppMemberLogin",
                    indexText: "会员登录",
                    requestRemark:
                        "username: 卡号/手机号/名称/OpenId,orgCode: 机构编号",
                    requestContent: '{"username": "00150000001","orgCode": "0015"}',
                    responeContent: "登录",
                },
                {
                    index: "WXLogin",
                    indexText: "小程序一键登录",
                    requestRemark: "code:微信小程序登录code",
                    requestContent: '{"code": ""}',
                    responeContent: "小程序一键登录",
                },
                {
                    index: "WXTelLogin",
                    indexText: "微信小程序电话号码一键登录注册",
                    requestRemark:
                        "code:电话号码获取code,jscode:微信小程序登录code",
                    requestContent: '{"code": "","jscode":""}',
                    responeContent: "微信小程序电话号码一键登录注册",
                },

                {
                    index: "GetBaseConfigInfo",
                    indexText: "获取门店基础配置信息",
                    requestRemark: "",
                    requestContent:
                        '{"functionName": "GetBaseConfigInfo","contentData": {"orgCode": "0004"},"orgCode": "0004"}',
                    responeContent:
                        '',
                },

                {
                    index: "GetDicData",
                    indexText: "获取字典表数据",
                    requestRemark:
                        "parentCode:字典父级编号(可以到后台->系统管理->字典管理 查找) 011性别 561交易类型 564意见反馈类型",
                    requestContent:
                        '{"functionName": "GetDicData","contentData": {"parentCode":"561"},"orgCode": "0004"}',
                    responeContent: "Code:编号,Name:名称",
                },
                {
                    index: "MemberConsume",
                    indexText: "会员支付(小程序-支付)",
                    requestRemark:
                        "membercode:会员卡号,coinsValue:消费金币(目前没有规则,暂时按照账单10%额度支付金币),amtValue:消费金额,type:消费方式 0 余额 1金币 2优惠券满减,getPoints:获得积分,opType:消费类型 0 扫码消费 1 收银台消费 2 服务员消费 3其他,waiterCode:服务员代码,waiterName:服务员名称,referCode:关联单号",
                    requestContent:
                        '{"functionName": "MemberConsume","orgCode": "0004","contentData": {"memberCode":"000001","amtValue":"1","coinsValue":"0","type":"0","getPoints":"100","waiterCode":"123","waiterName":"张三","opType":"2","referCode":"123"}}',
                    responeContent: "消费完成",
                },
                {
                    index: "MemberTransactionRecord_Mini",
                    indexText: "会员交易记录(小程序-我的-交易记录)",
                    requestRemark:
                        "membercode:会员卡号,type:类型 561002 会员储值 561001 他人储值 561003 堂食消费 561004 消费退款,startDate:开始时间,endDate:结束时间,pageSize:每页数量,pageIndex:页码",
                    requestContent:
                        '{"functionName": "MemberTransactionRecord_Mini","orgCode": "0004","contentData": {"memberCode":"000001","type":"561001","startDate":"2023-01-10 19:00:00","endDate":"2025-01-10 19:00:00","pageSize":"10","pageIndex":"1"}}',
                    responeContent:
                        "memberCode:会员卡号,memberName:会员名称,operDate:交易时间,monthStr:月,dayStr:天,timeStr:时间,operAmt:操作金额,currentAmt:余额,operType:类型,operTypeName:类型名称",
                },
                // {
                //     index: "GetSchemeList",
                //     indexText: "获取充值方案(会员小程序-我的-储值方案)",
                //     requestRemark: "暂时每设定参数，后期应该要区分机构",
                //     requestContent:
                //         '{"functionName": "GetSchemeList","contentData": ""}',
                //     responeContent: "Code:充值方案编号,Name:方案名称,ChargeAmt:充值金额,PresentAmt:赠送金额,PresentPoint:赠送积分;PresentCoins:赠送金币;Tickets:赠送优惠券集合{SchemeCode:充值方案编号;TicketCode:优惠券编号;TicketName:优惠券名称;TicketAmt:优惠券额度;TypeName:类型}",
                // },
                // {
                //     index: "GetMemberReserveList_Mini",
                //     indexText: "会员预定列表(小程序-预定订单)",
                //     requestRemark: "membercode:会员卡号,startDate:开始时间,endDate:结束时间,pageSize:当页条数,pageIndex:页码",
                //     requestContent:
                //         '{"functionName": "GetMemberReserveList_Mini","contentData": {"memberCode":"000001","startDate":"2023-01-10 19:00:00","endDate":"2025-01-10 19:00:00","pageSize":"20","pageIndex":"1"}}',
                //     responeContent: "{reserveCode:预定编号,roomCode:房台号,roomName:房台名称,minConsume:低消,memberCode:会员卡号,memberName:会员名称,memberMobile:手机号,peopleNumber:人数,reserveTime:预定时间,keepFullTime:预留时间,maintainUserName:订台人,sourceTypeCode:来源编号,sourceTypeName:来源名称,state:状态,remark:备注,cancelReason:取消原因",
                // },
                {
                    index: "GetGoodsTypeOrg_Mini",
                    indexText: "商品分类(小程序-点单)",
                    requestRemark: "",
                    requestContent:
                        '{"functionName":"GetGoodsTypeOrg_Mini","orgCode": "0004","contentData":""}',
                    responeContent: "{goodsTypeCode:分类编码,goodsTypeName:分类名称,state:状态}",
                },
                {
                    index: "MemberOrderAdd_Mini",
                    indexText: "会员点单(小程序-点单)",
                    requestRemark:
                        "orderBatchCode:点单批次号(场景:会员点单未支付,后续继续点单需要传此批次号),consumeCode:当前桌台订单号,orderTime:点单时间,memberCode:会员卡号,Remark:备注,detail:点单详情,itemCode:主键(新增时候为空),doType:操作类型(Add:新增Edit修改Delte删除),itemType:记录说明(1单品2套餐3套餐详情),goodsPriceCode:套餐编码(单品为空),goodsCode:商品编码,goodsName:商品名称,uomCode:单位编码,uomName:单位名称,flavor:口味,salePrice:售价,vipPrice:会员价,orderQty:点单数量,producePoint:出品点",
                    requestContent:
                        '{"functionName":"MemberOrderAdd_Mini","orgCode": "0004","contentData":{"orderBatchCode":"","roomCode":"0004003","orderTime":"2024-03-01 13:04:04","memberCode":"000001","remark":"速上","detail":[{"itemCode":"","doType":"add","indexStr":"1","itemType":"1","goodsPriceCode":"","goodsCode":"p000001","goodsName":"百威","uomCode":"041010","uomName":"支","flavor":"加冰","salePrice":"30","vipPrice":"29","orderQty":"2","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"2","itemType":"2","goodsPriceCode":"p013087","goodsCode":"p013087","goodsName":"醇黑套餐","uomCode":"041006","uomName":"套","flavor":"","salePrice":"470.00","orderQty":"1","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"3","itemType":"3","goodsPriceCode":"p013087","goodsCode":"p013086","goodsName":"醇黑","uomCode":"041010","uomName":"支","flavor":"加冰","salePrice":"400","orderQty":"1","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"4","itemType":"3","goodsPriceCode":"p013087","goodsCode":"p000009","goodsName":"可乐","uomCode":"041010","uomName":"支","flavor":"加冰","salePrice":"10","orderQty":"6","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"5","itemType":"3","goodsPriceCode":"p013087","goodsCode":"p000007","goodsName":"纸巾","uomCode":"041008","uomName":"包","flavor":"","salePrice":"5","orderQty":"2","producePoint":"000403"}]}}',
                    responeContent:
                        "{orderBatchCode:订单批次号,consumeCode:消费单号,expireTime:支付截至时间,indexStr:序号,itemCode:明细code}",
                },
                {
                    index: "MemberReverseOrderAdd_Mini",
                    indexText: "会员点单预点单(小程序-预定)",
                    requestRemark:
                        "reverseCode:预定编号,roomCode:桌台号,orderTime:点单时间,memberCode:会员卡号,Remark:备注,detail:点单详情,itemCode:主键(新增时候为空),doType:操作类型(Add:新增Edit修改Delte删除),itemType:记录说明(1单品2套餐3套餐详情),goodsPriceCode:套餐编码(单品为空),goodsCode:商品编码,goodsName:商品名称,uomCode:单位编码,uomName:单位名称,flavor:口味,salePrice:售价,orderQty:点单数量,producePoint:出品点",
                    requestContent:
                        '{"functionName":"MemberReverseOrderAdd_Mini","orgCode": "0004","contentData":{"reverseCode":"0004202404090009","roomCode":"0004003","orderTime":"2024-03-01 13:04:04","memberCode":"000001","remark":"速上","detail":[{"itemCode":"","doType":"add","indexStr":"1","itemType":"1","goodsPriceCode":"","goodsCode":"p000001","goodsName":"百威","uomCode":"041010","uomName":"支","flavor":"加冰","salePrice":"30","orderQty":"2","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"2","itemType":"2","goodsPriceCode":"p013087","goodsCode":"p013087","goodsName":"醇黑套餐","uomCode":"041006","uomName":"套","flavor":"","salePrice":"470.00","orderQty":"1","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"3","itemType":"3","goodsPriceCode":"p013087","goodsCode":"p013086","goodsName":"醇黑","uomCode":"041010","uomName":"支","flavor":"加冰","salePrice":"400","orderQty":"1","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"4","itemType":"3","goodsPriceCode":"p013087","goodsCode":"p000009","goodsName":"可乐","uomCode":"041010","uomName":"支","flavor":"加冰","salePrice":"10","orderQty":"6","producePoint":"000403"},{"itemCode":"","doType":"add","indexStr":"5","itemType":"3","goodsPriceCode":"p013087","goodsCode":"p000007","goodsName":"纸巾","uomCode":"041008","uomName":"包","flavor":"","salePrice":"5","orderQty":"2","producePoint":"000403"}]}}',
                    responeContent:
                        "{orderBatchCode:订单批次号,consumeCode:消费单号,expireTime:支付截至时间,indexStr:序号,itemCode:明细code}",
                },
                {
                    index: "GetMemberOrderInfo_Mini",
                    indexText: "获取已点订单(小程序-已点订单)",
                    requestRemark: "consumeCode:当前桌台订单号",
                    requestContent:
                        '{"functionName": "GetMemberOrderInfo_Mini","orgCode": "0004","contentData": {"consumeCode":"0004202403130002"}}',
                    responeContent:
                        "{operType:点单记录类型(0:删除完全不要了,1:正常需要买单,2:签送商品,3:取酒,4:换入,5:换出,6:兑换),goodsPriceCode:套餐编号,goodsCode:商品编号,roomCode:房台编号,roomName:房台名称,orderBatchCode:订单批次号,consumeCode:消费单号,memberName:会员名称,memberMobile:会员手机号,state:支付状态,payName:支付类型,payBatchCode:支付批次号,orderTime:点单时间,payTime:付款时间,totalAmt:订单总额,realAmt:实际支付金额,smallChange:抹零金额,payAmt:支付金额,needPay:是否需要支付 1 需求 0不需要,flavor:选项,payCoins:支付金币,remark:点单备注,orderGoodsInfos:[{itemType:商品类型 1 商品 2 套餐 3套餐详情,itemCode:子项编号,orderBatchCode:订单批次号,consumeCode:消费单号,goodsPriceCode:套餐编号,goodsCode:商品编号,goodsName:商品名称,uomName:单位,realQty:实际数量,orderQty:订单数量,standard:规格,totalAmt:总金额,flavor:备注选择,attachment:图片,mainAttachment:主图片,realAmt:实际金额,payAmt:支付金额,orderTime:点单时间,orderUser:订单人,orderUserName:订单人名称,IsShow:是否展示,goodsPriceInfos:[{itemCode:子项编号,goodsCode:商品编号,goodsName:商品名称,uomName:单位,realQty:实际数量,orderQty:订单数量,totalAmt:总金额,realAmt:实际支付金额,payAmt:支付金额,standard:规格,flavor:加冰,attachment:图片,mainAttachment:主图片}]}",
                },
                {
                    index: "MemberOrderCancel_Mini",
                    indexText: "取消订单(小程序-已点订单)",
                    requestRemark: "orderBatchCode:当前桌台订单批次号",
                    requestContent:
                        '{"functionName": "MemberOrderCancel_Mini","orgCode": "0004","contentData": {"orderBatchCode":"0004202402050005200908"}}',
                    responeContent: "取消成功、取消失败",
                },
                {
                    index: "PayOrder_Mini",
                    indexText: "点单-支付接口",
                    requestRemark:
                        "orderBatchCode:订单号,roomCode:房间号,consumeCode:消费单号,fee:金额",
                    requestContent:
                        '{"functionName": "PayOrder_Mini","orgCode": "0004","contentData": {"orderBatchCode":"","roomCode":"","consumeCode":"","fee":""}}',
                    responeContent: "调起支付参数",
                },
                {
                    index: "PayMemberUp_Mini",
                    indexText: "会员卡权益-支付接口",
                    requestRemark:
                        "cardNo:卡号,fee:金额",
                    requestContent:
                        '{"functionName": "PayMemberUp_Mini","orgCode": "0004","contentData": {"cardNo":"00000001","fee":"1"}}',
                    responeContent: "调起支付参数",
                },

                {
                    index: "GetOrdersPay_Mini",
                    indexText: "获取订单商品付款(小程序-点单)",
                    requestRemark: "orderBatchCode:批次点单号",
                    requestContent:
                        '{"functionName": "GetOrdersPay_Mini","orgCode": "0004","contentData": {"orderBatchCode":""}}',
                    responeContent:
                        "{goodsCount:商品总数量,totalPayAmt:订单总金额,expireTime:买单截至时间,goodsInfo:[{goodsName:商品名称,uomName:单位,orderQty:订单数量,totalAmt:总金额,salePrice:销售价,goodsDetail:[{goodsName:套餐明细商品,uomName:单位,orderQty:订单数量,totalAmt:总金额,salePrice:销售价}]}]}",
                },
                {
                    index: "GetMemberGoodsInfo_Mini",
                    indexText: "获取商品列表(小程序-点单)",
                    requestRemark: "orderBatchCode:批次点单号",
                    requestContent:
                        '{"functionName": "GetMemberGoodsInfo_Mini","orgCode": "0004","contentData": ""}',
                    responeContent:
                        "{goodsCount:商品总数量,totalPayAmt:订单总金额,goodsInfo:[{goodsName:商品名称,uomName:单位,orderQty:订单数量,totalAmt:总金额,salePrice:销售价,goodsDetail:[{goodsName:套餐明细商品,uomName:单位,orderQty:订单数量,totalAmt:总金额,salePrice:销售价}]}]}",
                },
                {
                    index: "GetOrdersMemberTicket_Mini",
                    indexText: "会员点单获取会员金币余额优惠券(小程序-点单)",
                    requestRemark: "orderBatchCode:批次点单号",
                    requestContent:
                        '{"functionName": "GetOrdersMemberTicket_Mini","orgCode": "0004","contentData": {"orderBatchCode":"","memberCode":"000001"}}',
                    responeContent:
                        "{totalSaleCoins:抵扣金币,totalMemberCoins:会员可抵扣金币,useTicket 可用优惠券:[{ticketCode:优惠券编号,ticketName:优惠券名称,tieketAmt:卷面金额,discounts:折扣,expireDate:过期时间}],useTicketCount:可用优惠券数量,unUseTicket 不可用优惠券:[{ticketCode:优惠券编码,ticketName:优惠券名称,tieketAmt:卷面金额,discounts:折扣,expireDate:过期时间}]}",
                },
                {
                    index: "GetOrganizeCity_Mini",
                    indexText: "获取有门店的城市列表(小程序-预定)",
                    requestRemark: "",
                    requestContent:
                        '{"functionName": "GetOrganizeCity_Mini","orgCode": "0004","contentData": {}}',
                    responeContent: "",
                },
                {
                    index: "GetOrganize_Mini",
                    indexText: "获取门店列表(小程序-预定)",
                    requestRemark: "City:所属城市,Latitude:纬度,Longitude:经度,OrgName:门店名称",
                    requestContent:
                        '{"functionName": "GetOrganize_Mini","orgCode": "0004","contentData": {"City":"全部","Latitude":"26.089375","Longitude":"119.361520","OrgName":""}}',
                    responeContent: "",
                },
                {
                    index: "GetReserveList_Mini",
                    indexText: "获取预定列表(小程序-预定)",
                    requestRemark:
                        "orgCode:机构编号\r\nmemberMobile:手机号\r\ndateType:1(1:今日 2:历史)\r\npageSize:分页数\r\npageIndex:分页码",
                    requestContent:
                        '{"functionName": "GetReserveList_Mini","orgCode": "0004","contentData": {"memberMobile":"18605015820","dateType":"1","pageSize":"15","pageIndex":"1"}}',
                    responeContent: "",
                },
                {
                    index: "AddReserveRoom_Mini",
                    indexText: "新增预定信息(小程序-预定)",
                    requestRemark:
                        "orgCode:机构编号\r\nmemberName:会员名称 \r\n memberMobile:手机号 \r\n peopleNum:预订人数 \r\n reserveTime:预订时间  \r\n roomCode:房间号 \r\n minConsume:房台低消 \r\n remark:备注",
                    requestContent:
                        '{"functionName": "AddReserveRoom_Mini","orgCode": "0004","contentData": {"memberName":"打工人","memberMobile":"18605015820","peopleNum":"3","reserveTime":"2024-03-21 10:00:00","roomCode":"0004003","minConsume":"100","remark":""}}',
                    responeContent: "",
                },
                {
                    index: "GetReserveRoomList_Mini",
                    indexText: "获取可预定房台列表(小程序-预定)",
                    requestRemark: "orgCode:机构编号\r\nreserveTime:预订时间",
                    requestContent:
                        '{"functionName": "GetReserveRoomList_Mini","orgCode": "0004","contentData": {"reserveTime":"2024-03-21 10:00:00"}}',
                    responeContent: "",
                },
                {
                    index: "CancelReserve_Mini",
                    indexText: "取消预订(小程序-预定)",
                    requestRemark: "orgCode:机构编号\r\ncode:预订编码\r\n reason:取消原因",
                    requestContent:
                        '{"functionName": "CancelReserve_Mini","orgCode": "0004","contentData": {"code":"","reason":"个人原因"}}',
                    responeContent: "",
                },
                {
                    index: "GetMiniProgramView",
                    indexText: "获取小程序浏览量",
                    requestRemark: "",
                    requestContent:
                        '{"functionName":"GetMiniProgramView","orgCode": "0004","contentData":{}}',
                },
                {
                    index: "GetQueueList_Mini",
                    indexText: "获取排队取号列表(小程序-排队取号)",
                    requestRemark: "orgCode:机构编号\r\n",
                    requestContent:
                        '{"functionName": "GetQueueList_Mini","orgCode": "0004","contentData": {"orgCode":"0004"}}',
                    responeContent:
                        '{"queneSymbol":"C","queneName":"家庭桌","queneCount":"1","queneDesc":"5-6人"}',
                },
                {
                    index: "AddQueueCall_Mini",
                    indexText: "新增排队取号(小程序-排队取号)",
                    requestRemark: "orgCode:机构编号\r\n",
                    requestContent:
                        '{"functionName": "AddQueueCall_Mini","orgCode": "0004","contentData": {"orgCode":"0004","memberName":"打工人","memberMobile":"18605015820","peopleNum":"3","remark":""}}',
                    responeContent: "{}",
                },
                {
                    index: "GetQueueInfo_Mini",
                    indexText: "获取排队信息(小程序-排队取号)",
                    requestRemark: "orgCode:机构编号\r\n",
                    requestContent:
                    '{"functionName": "GetQueueInfo_Mini","orgCode": "0004","contentData": {"orgCode":"0004","memberMobile":"18605015821"}}',
                    responeContent:
                    '{"code":"0004202403190002","callNo":"B2","memberName":"打工人1号","memberMobile":"18605015821","peopleNum":"3","waitNum":"1桌","waitTime":"11分钟"}',
                },
                {
                    index: "GetQueueInfoByCode",
                    indexText: "根据排队编码获取信息",
                    requestRemark: "code:排队编号",
                    requestContent:
                        '{"functionName": "GetQueueInfoByCode","orgCode": "0004","contentData": {"code":""}}',
                    responeContent:
                        '{"orgCode":"机构编码","orgName":"机构名称","callNo":"排队号码","memberName":"会员名称","memberMobile":"会员手机号","peopleNum":"排队人数","callNum":"呼叫次数","waitNum":"等待桌数","waitTime":"等待时长","state":"状态","stateDesc":"状态描述","queueTime":"排队时间"}',
                       
                },
                {
                    index: "CancelQueue_Mini",
                    indexText: "取消排队信息(小程序-排队取号)",
                    requestRemark: "orgCode:机构编号\r\n",
                    requestContent:
                        '{"functionName": "CancelQueue_Mini","orgCode": "0004","contentData": {"orgCode":"0004","code":"0004202403190002","remark":""}}',
                    responeContent:
                        '{"objectList":[{"object":"CancelQueue_Mini","rowData":"取消成功"}]}',
                },
                {
                    index: "GetQueueRecord_Mini",
                    indexText: "获取排队记录(小程序-排队取号)",
                    requestRemark: "orgCode:机构编号\r\n",
                    requestContent:
                        '{"functionName": "GetQueueRecord_Mini","orgCode": "0004","contentData": {"orgCode":"0004","memberMobile":"18605015820","pageSize":"15","pageIndex":"1"}}',
                    responeContent: "",
                },
                {
                    index: "GetWineStoreList_Mini",
                    indexText: "获取我的存酒列表(小程序-存取酒)",
                    requestRemark:
                        "orgCode:机构编号\r\nmemberMobile:手机号 \r\n state(1:将过期  2:已过期)\r\npageSize:分页数\r\npageIndex:分页页码",
                    requestContent:
                        '{"functionName": "GetWineStoreList_Mini","orgCode": "0004","contentData": {"orgCode":"0004","memberMobile":"18605015820","state":"","pageSize":"15","pageIndex":"1"}}',
                    responeContent: "",
                },
                {
                    index: "OpWineTask_Mini",
                    indexText: "取酒操作(小程序-存取酒)",
                    requestRemark:
                        "orgCode:机构编号\r\ncode:存酒编码\r\nroomCode:房间号\r\ntakeQty:取酒数量",
                    requestContent:
                        '{"functionName": "OpWineTask_Mini","orgCode": "0004","contentData": {"orgCode":"0004","code":"0004202403140001","roomCode":"0004003","takeQty":"1"}}',
                    responeContent: "",
                },
                {
                    index: "GetTaskWineRecord_Mini",
                    indexText: "获取我的取酒记录(小程序-存取酒)",
                    requestRemark:
                        "orgCode:机构编号\r\nmemberMobile:手机号\r\npageSize:分页数\r\npageIndex:分页页码\r\nbeginTime:开始时间\r\nendTime:结束时间",
                    requestContent:
                        '{"functionName": "GetTaskWineRecord_Mini","orgCode": "0004","contentData": {"orgCode":"0004","memberMobile":"18605015820","pageSize":"15","pageIndex":"1","beginTime":"","endTime":""}}',
                    responeContent: "",
                },
                {
                    index: "CallWaiter_Mini",
                    indexText: "呼叫服务员(小程序-存取酒)",
                    requestRemark: "orgCode:机构编号\r\nmemberMobile:手机号 \r\n roomCode:房间号",
                    requestContent:
                        '{"functionName": "CallWaiter_Mini","orgCode": "0004","contentData": {"orgCode":"0004","memberMobile":"18605015820","roomCode":"0004003"}}',
                    responeContent: "",
                },
                {
                    index: "GetSchemeList_Mini",
                    indexText: "储值方案(小程序-储值)",
                    requestRemark:
                        "orgCode:机构编号",
                    requestContent:
                        '{"functionName": "GetNewSchemeList_Mini","orgCode": "0004","contentData": {"typeCode":"卡类型","BrandCode":"品牌编码,卡类型为品牌卡时传入"}}',
                    responeContent:
                        "Code:充值方案编号,Name:方案名称,ChargeAmt:充值金额,PresentAmt:赠送金额,PresentPoint:赠送积分;PresentCoins:赠送金币;Tickets:赠送优惠券集合{SchemeCode:充值方案编号;TicketCode:优惠券编号;TicketName:优惠券名称;TicketAmt:优惠券额度;TypeName:类型}",
                },
                {
                    index: "MenberRechargeMini",
                    indexText: "小程序会员储值",
                    requestRemark:
                        "schemeCode:储值方案编码,otherCode:为他人储值的会员编码",
                    requestContent:
                        '{"functionName": "MenberRechargeMini","orgCode": "0004","contentData": {"schemeCode":"","otherCode":""}}',
                    responeContent:
                        "Code:充值方案编号,Name:方案名称,ChargeAmt:充值金额,PresentAmt:赠送金额,PresentPoint:赠送积分;PresentCoins:赠送金币;Tickets:赠送优惠券集合{SchemeCode:充值方案编号;TicketCode:优惠券编号;TicketName:优惠券名称;TicketAmt:优惠券额度;TypeName:类型}",
                },
                {
                    index: "CheckMember_Mini",
                    indexText: "会员验证(小程序-储值)",
                    requestRemark: "mobile:手机号",
                    requestContent:
                        '{"functionName": "CheckMember_Mini","orgCode": "0004","contentData": {"mobile":"手机号"}}',
                    responeContent: "carName:卡名称,orgCode:机构编号",
                },
                {
                    index: "GetMemberTicket_Mini",
                    indexText: "获取会员优惠券(小程序-我的)",
                    requestRemark:
                        "MemberCarCode:卡号;ticketState 状态 1未使用 2已使用 3已过期;ticketName:名称,pageSize:每一页大小,page:页码",
                    requestContent:
                        '{"functionName": "GetMemberTicket_Mini","orgCode": "0004","contentData": {"MemberCarCode":"000001","ticketState":"","ticketName":"","pageSize":"10","page":"1"}}',
                    responeContent: `notUsed:未使用数量,used:已使用,expired:已过期,result:[Code:卡券编号,TicketName:优惠券名称,TicketCode:优惠券编号,UseConditionAmt:使用金额(满xx金额使用),TypeName:类型,CreateDate:创建时间,ExpireDate:失效时间,TicketAmt:卷面额度,attachment:图片路径
                    isUseByCondition:是否使用限制条件 0 否 1是,useLimit:使用数量,useAmt:满金额,grantCountLimit:"发放数量限制 0不限制 1限制",
                    countLimit:限制数量,maxCount:最大存量,usefulDateType:"有效期类型 1 时间段 2 天数",startData:"开始时间",endData:"结束时间",limitDays:领取后天数,usefulWeek:"可使用星期;1 全部星期 2 部分星期",
                    weekStr":"部分星期选择;都号隔开",usefulTime:"可使用时间;1全部时间 2 部分时间段",timeStr:"部分时间端选择;分号隔开",limitUseOneTime:每次最多使用,limitUseOneDay:每天最多使用,ticketCoverType:"卷面样式;1 默认封面 2自定义封面"
                    ,Goods[{GoodsCode:商品编号,GoodsName:商品名称,GoodsCount:商品数量,UnitName:单位}],goodsLimit:[{goodsCode:限制商品编号,goodsName:限制商品名称,typeCode:限制类型编号,typeName:限制类型}]]`,
                },
                {
                    index: "GetUseMemberTicket_Mini",
                    indexText: "获取会员支付优惠券(点单-优惠券)",
                    requestRemark:
                        `memberCarCode:会员卡号,consumeCode:消费单号,orderDetails:点单列表`,
                    requestContent:
                        '{"functionName":"GetUseMemberTicket_Mini","orgCode": "0004","contentData":{"memberCarCode":"00040000045","consumeCode":"0004202405200001","orderDetails":"[{\'goodsCode\':\'P000023\',\'uomCode\':\'041011\',\'goodsName\':\'鸡爪\',\'salePrice\':\'48.00\',\'orderQty\':\'1\'}]"}}',
                },
                {
                    index: "MemberInfo_Mini",
                    indexText: "会员信息(小程序-我的)",
                    requestRemark: "Code:卡号/手机号/openId",
                    requestContent:
                        '{"functionName": "MemberInfo_Mini","orgCode": "0004","contentData": {"code":"000016"}}',
                    responeContent:
                        "regCard已注册卡:[backgroundAtt:卡背景图,attachment:头像路径,nickName:昵称,Code:会员卡号;Name:名称;MemberLevelName:级别名称;Sex:性别 011002女 011001 男;Birthday:生日;Mobile:手机号;CurrentAmtAct:余额;CurrentCoins:金币;CoinsRate:金币使用比例(按照账单总额);CurrentPoint:积分;PointsRate:积分获取比例(按照支付金额);ticketCount:优惠券数量,RegDate:注册时间,ExpireDate:有效时间],unRegCard未注册卡:[{carCode:卡类型编码,carName:卡类型名称}]",
                },
                {
                    index: "UpdateMemberInfo_Mini",
                    indexText: "会员编辑(小程序-我的)",
                    requestRemark:
                        "Code:卡号;mobile:手机号;nickName:名称;sex:性别;birthday:生日,attachment:头像路径",
                    requestContent:
                        '{"functionName": "UpdateMemberInfo_Mini","orgCode": "0004","contentData": {"code":"000016","mobile": "13123456789","nickName": "名字","sex": "011001","birthday": "1994-07-19","attachment":""}}',
                    responeContent: "更新",
                },
                {
                    index: "MemberScheme_Mini",
                    indexText: "会员充值/他人充值(小程序-我的-充值)",
                    requestRemark:
                        "amt:充值金额(如果选择了充值方案,优先获取充值方案金额),code:会员卡号/手机号/openId,type:充值类型 0自行充值 2 他人充值,schemeCode:充值方案编号",
                    requestContent:
                        '{"functionName": "MemberScheme_Mini","orgCode": "0004","contentData": {"amt":"1","code":"000001","type":"1","schemeCode":"123"}}',
                    responeContent: "充值完成",
                },
                {
                    index: "MemberTransactionCoinsRecord_Mini",
                    indexText: "金币交易记录(小程序-我的)",
                    requestRemark:
                        "memberCode:会员卡号,pageSize:每页大小,pageIndex:页码",
                    requestContent:
                        '{"functionName": "MemberTransactionCoinsRecord_Mini","orgCode": "0004","contentData": {"memberCode":"000001","pageSize":"15","pageIndex":"1"}}',
                    responeContent:
                        "{currentCoins:当前金币余额,history:{月份2024-03:[{operTypeName:操作类型,opreCoins:操作金币,datetime:时间}]}}",
                },
                {
                    index: "GetOrderRecord_Mini",
                    indexText: "订单记录(小程序-订单)",
                    requestRemark:
                        "memberCode:会员卡号,dateType:1今日,2历史,pageSize:每页大小,pageIndex:页码",
                    requestContent:
                        '{"functionName": "GetOrderRecord_Mini","orgCode": "0004","contentData": {"memberCode":"000001","dateType":"1","pageSize":"15","pageIndex":"1"}}',
                    responeContent:
                        "{currentCoins:当前金币余额,expireTime:支付截至时间,history:{月份2024-03:[{operTypeName:操作类型,opreCoins:操作金币,datetime:时间}]}}",
                },
                {
                    index: "GetOrderRecordDetail_Mini",
                    indexText: "订单详情(小程序-订单)",
                    requestRemark: "orderBatchCode:订单编号",
                    requestContent:
                        '{"functionName": "GetOrderRecordDetail_Mini","orgCode": "0004","contentData": {"orderBatchCode":"0004202402050005200908"}}',
                    responeContent: `{operType:2(签送)1(正常点单),roomCode:桌台号,expireTime:支付截止时间,roomName:桌台名称,orderBatchCode:订单批次号,consumeCode:订单号,memberName:人数,state:支付状态,payName:支付方式,payBatchCode:支付批次号
						,orderTime:下单时间,payTime:支付时间,totalAmt:总金额,realAmt:实际支付金额,needPay:是否需要支付,payCoins:抵扣金币,remark:备注,payTypaDic[]:支付方式和金额
						,orderGoodsInfos:[{itemCode:编号,orderBatchCode:订单批次好,consumeCode:订单号,goodsPriceCode:商品编号,goodsCode:商品编号,goodsName:商品名称,uomName:单位,realQty:数量,orderQty:订单数量,standard:规格,totalAmt:总金额,realAmt:实际支付金额,payAmt:支付金额,orderTime:订单时间,orderUser:订单人,orderUserName:订单人,IsShow:是否显示,goodsPriceInfos:[{itemCode:编号,goodsCode:商品编号,goodsName:商品名称,uomName:单位,realQty:数量,orderQty:订单数量,totalAmt:金额,realAmt:实际支付金额,payAmt:支付金额,standard:规格}]}]}`,
                },
                {
                    index: "MemberOrderPay_Mini",
                    indexText: "买单(小程序-订单)",
                    requestRemark: `门店取登录的门店编码,consumeCode:消费单号,roomCode:房台编码,payUser:付款人(代付),payBatchCode:批次号(首次买单为空,后续再买单将首次的批次号传入),detailList:付款商品列表(使用点单的itemCode),orderAmt:点单商品金额,realPayAmt:实际收款金额,payList:支付列表(手机端只有一条,电脑端可能有多条),totalAmt:本次需要的付款金额,payAmt:客人付款金额(现金可能大于点单金额,需要有找零和抹零,其他方式totalAmt==payAmt),giveChange:找零金额,smallChange:抹零金额,memberCode:会员编码(会员付款),memberName:会员姓名,memberMobile:电话,memberOpenId:openid,payType:支付方式(001现金002微信003支付宝004会员卡005消费卷)`,
                    requestContent:
                        '{"functionName":"MemberOrderPay_Mini","orgCode": "0004","contentData":{"serviceAmt":[{"type":"会员折扣优惠","amt":"金额(使用权益会员卡优惠的金额)"}],"consumeCode":"0004202402050006","roomCode":"0004003","memberTicketCode":"会员券编码","payUser":"","payBatchCode":"","detailList":"0004202402050006001,0004202402050006002","orderAmt":"495.5","realPayAmt":"495","payList":[{"totalAmt":"495.5","payAmt":"500","giveChange":"5","smallChange":"0.5","memberCode":"","memberName":"","memberMobile":"","memberOpenId":"","payType":"001"}]}}',
                    responeContent: `{payBatchCode:买单批次号,payAmt:付款金额,smallChange:抹零金额}`,
                },
                {
                    index: "AddSignIn",
                    indexText: "新增签到",
                    requestRemark:
                        "activityCode:活动编码 \r\n signInTime:签到时间",
                    requestContent:
                        '{"functionName": "AddSignIn","orgCode": "0015","contentData": {"activityCode":"0015001"}}',
                    responeContent: "",
                },
                {
                    index: "GetSignInRecord",
                    indexText: "获取签到记录",
                    requestRemark:
                        "date:2024-06",
                    requestContent:
                        '{"functionName": "GetSignInRecord","orgCode": "0015","contentData": {"date":""}}',
                    responeContent: "",
                },
               

                // {
                //     index: "GetMemberLists",
                //     indexText: "会员列表(服务员点单)",
                //     requestRemark:
                //         "Key:卡号/手机号 空字符串 查询所有,pageSize:每页行数,page:页码 从1开始",
                //     requestContent:
                //         '{"functionName": "GetMemberLists","contentData": {"key":"000016","pageSize":"10","page":"1"}}',
                //     responeContent:
                //         "Code:卡号,Name:姓名,Mobile:手机号,CurrentAmtAct:余额,LastDate:最后消费时间",
                // },
                // {
                //     index: "GetMemberCount",
                //     indexText: "会员列表统计(服务员点单)",
                //     requestRemark: "默认查询当天",
                //     requestContent:
                //         '{"functionName": "GetMemberCount","contentData": ""}',
                //     responeContent:
                //         "AllCount:所有人数,TodayCount:当日新增人数,TodayCharge:当日充值金额",
                // },
                // {
                //     index: "GetMemberChargeRecord",
                //     indexText: "会员充值记录(服务员点单)",
                //     requestRemark:
                //         "memberCode:卡号,pageSize:每页行数,page:页码从1开始",
                //     requestContent:
                //         '{"functionName": "GetMemberChargeRecord","contentData": {"memberCode":"000001","pageSize":"10","page":"1"}}',
                //     responeContent:
                //         "CrDate:充值时间,ChargeAmt:充值金额,ReferCode:关联单号,TypeName:方式",
                // },
                // {
                //     index: "GetMemberCoinsRecord",
                //     indexText: "会员金币消费记录(服务员点单)",
                //     requestRemark:
                //         "memberCode:卡号,pageSize:每页行数,page:页码从1开始",
                //     requestContent:
                //         '{"functionName": "GetMemberCoinsRecord","contentData": {"memberCode":"000001","pageSize":"10","page":"1"}}',
                //     responeContent:
                //         "CrDate:消费时间,ConsumeCoins:消费金币,ReferCode:关联单号,TypeName:方式",
                // },
                // {
                //     index: "GetMemberConsumeRecord",
                //     indexText: "会员消费记录(服务员点单)",
                //     requestRemark:
                //         "memberCode:卡号,pageSize:每页行数,page:页码从1开始",
                //     requestContent:
                //         '{"functionName": "GetMemberConsumeRecord","contentData": {"memberCode":"000001","pageSize":"10","page":"1"}}',
                //     responeContent:
                //         "CrDate:消费时间,consumeAmt:消费金额,ReferCode:关联单号,TypeName:方式",
                // },
                // {
                //     index: "MemberOpenCrad",
                //     indexText: "会员开卡注册(服务员点单)",
                //     requestRemark:
                //         "orgCode: 组织代码,orgName: 组织名称,mobiles: 手机号,openId: 微信OpenId,wechat: 微信号,name: 姓名,sex: 性别 (011002 女 011001 男),birthday: 生日",
                //     requestContent:
                //         '{"functionName": "MemberOpenCrad","contentData": { "orgCode": "00004","orgName": "卯兔","mobiles": "13322222222","openId": "123","wechat": "123","name": "姓名","sex": "011002","birthday": "2024-10-11 11:11:11"}}',
                //     responeContent: "开卡",
                // },
                // {
                //     index: "UpdateMember",
                //     indexText: "会员编辑(服务员点单)",
                //     requestRemark:
                //         "Code:卡号;mobile:手机号;name:名称;sex:性别;birthday:生日",
                //     requestContent:
                //         '{"functionName": "UpdateMember","contentData": {"code":"000016","mobile": "13123456789","name": "名字","sex": "011001","birthday": "1994-07-19"}}',
                //     responeContent: "更新",
                // },
                // {
                //     index: "GetMemberInfo",
                //     indexText: "会员信息(服务员点单)",
                //     requestRemark: "Code:卡号/手机号/openId",
                //     requestContent:
                //         '{"functionName": "GetMemberInfo","contentData": {"code":"000016"}}',
                //     responeContent:
                //         "Code:会员卡号;Name:名称;MemberLevelName:级别名称;Sex:性别 011002女 011001 男;Birthday:生日;Mobile:手机号;CurrentAmtAct:余额;CurrentCoins:金币;CoinsRate:金币使用比例(按照账单总额);CurrentPoint:积分;PointsRate:积分获取比例(按照支付金额);ticketCount:优惠券数量,RegDate:注册时间,ExpireDate:有效时间",
                // },
                // {
                //     index: "GetMemberTicket",
                //     indexText: "会员优惠券(服务员点单)",
                //     requestRemark:
                //         "memberCode:卡号;ticketState 状态 1未使用 2已使用 3已过期;ticketName:名称,pageSize:每页行数,page:页码从1开始",
                //     requestContent:
                //         '{"functionName": "GetMemberTicket","contentData": {"memberCode":"000001","ticketState":"","ticketName":"","pageSize":"10","page":"1"}}',
                //     responeContent: `Code:卡券编号,TicketName:优惠券名称,TicketCode:优惠券编号,UseConditionAmt:使用金额(满xx金额使用),TypeName:类型,CreateDate:创建时间,ExpireDate:失效时间,TicketAmt:卷面额度,attachment:图片路径
                //     isUseByCondition:是否使用限制条件 0 否 1是,useLimit:使用数量,useAmt:满金额,grantCountLimit:"发放数量限制 0不限制 1限制",
                //     countLimit:限制数量,maxCount:最大存量,usefulDateType:"有效期类型 1 时间段 2 天数",startData:"开始时间",endData:"结束时间",limitDays:领取后天数,usefulWeek:"可使用星期;1 全部星期 2 部分星期",
                //     weekStr":"部分星期选择;都号隔开",usefulTime:"可使用时间;1全部时间 2 部分时间段",timeStr:"部分时间端选择;分号隔开",limitUseOneTime:每次最多使用,limitUseOneDay:每天最多使用,ticketCoverType:"卷面样式;1 默认封面 2自定义封面"
                //     ,Goods[{GoodsCode:商品编号,GoodsName:商品名称,GoodsCount:商品数量,UnitName:单位}],goodsLimit:[{goodsCode:限制商品编号,goodsName:限制商品名称,typeCode:限制类型编号,typeName:限制类型}]`,
                // },
                // {
                //     index: "MemberScheme(服务员点单)",
                //     indexText: "会员充值",
                //     requestRemark:
                //         "amt:充值金额,membercode:会员卡号,type:充值类型 1收银台充值 0自行充值,waitercode:服务员代码,waitername:服务员名称",
                //     requestContent:
                //         '{"functionName": "MemberScheme","contentData": {"amt":"1","memberCode":"000001","type":"1","waiterCode":"123","waiterName":"张三"}}',
                //     responeContent: "充值完成",
                // },
                {
                    index: "MiniQueueSend(会员排号推送)",
                    indexText: "会员排号推送",
                    requestRemark:
                        "QueueNum:排队号码,PeopleNumber:等待人数\n需要小程序订阅之后才能发送消息",
                    requestContent:
                        '{"functionName": "MiniQueueSend","orgCode": "0004","contentData": {"QueueNum":"","PeopleNumber":""}}',
                    responeContent: "充值完成",
                },
                {
                    index: "SendMemberTicket_Mini(赠送优惠券)",
                    indexText: "赠送优惠券",
                    requestRemark:
                        "memberCode:会员卡号,ticketCode:优惠券编号 000001 优惠券 000002 酒水券 000003 商品券,TicketState:0未开始 1未使用 2已使用 3已过期",
                    requestContent:
                        '{"functionName": "SendMemberTicket_Mini","orgCode": "0004","contentData": {"memberCode":"0004000005","ticketCode":"000001","TicketState":"1"}}',
                    responeContent: "充值完成",
                },
                {
                    index: "GetRoomInfo_Mini(获取房台信息)",
                    indexText: "获取房台信息",
                    requestRemark:
                        "roomCode:房台编号",
                    requestContent:
                        '{"functionName": "GetRoomInfo_Mini","orgCode": "0004","contentData": {"roomCode":"0004001"}}',
                    responeContent: "{code:编号 name 名称,minConsume:低消}",
                },
                {
                    index: "GetQrCodeMini",
                    indexText: "获取二维码",
                    requestRemark:
                        "roomCode:房台编号,link:Order 点单 queue 排队,orgCode:0004 机构编码,version:版本 正式版为 release 体验版为 trial 开发版为 develop",
                    requestContent:
                        '{"roomCode":"0004001","link":"Order","orgCode":"0004","version":"trial"}',
                    responeContent: "{code:编号 name 名称,minConsume:低消}",
                },
                {
                    index: "GetRoomOpWine_Mini",
                    indexText: "获取取酒房台",
                    requestRemark:
                        "consumeState:房台状态 0 空闲 1预定 2使用 3未支付 传空取全部",
                    requestContent:
                        '{"functionName": "GetRoomOpWine_Mini","orgCode": "0004","contentData": {"consumeState":"2"}}',
                    responeContent: "{code:编号 name 名称}",
                },
                {
                    index: "GetRoomList_Mini",
                    indexText: "获取意见反馈-桌台列表",
                    requestRemark:
                        "",
                    requestContent:
                        '{"functionName": "GetRoomList_Mini","orgCode": "0004","contentData": ""}',
                    responeContent: "{code:编号 name 名称}",
                },
                {
                    index: "CreateFeedBack_Mini",
                    indexText: "提交意见反馈",
                    requestRemark:
                        "proType:问题类型,roomCode:房台编号,feedBackContent:问题和建议,attachment:附件",
                    requestContent:
                        '{"functionName": "CreateFeedBack_Mini","orgCode": "0004","contentData": {"proType":"","roomCode":"0004001","feedBackContent":"问题和建议","attachment":"""}}',
                    responeContent: "{code:编号 name 名称}",
                },
                {
                    index: "api/Upload",
                    indexText: "提交意见上传文件,通道FORM方式上传 地址：(http://172.18.3.8:8090/api/Upload或http://172.18.3.9:8090/api/Upload)",
                    requestRemark:
                        "Form: data:文件流,requestId:请求Id(随机生成),total:文件总数,index:序号,fileName:文件名(123.png),objName:目录(Mini),orgCode:机构编号,uploadType:OSS,bucketName:jtmc",
                    responeContent: "{code:编号 name 名称}",
                },
                {
                    index: "UpdateOrderDetailExpireTime_Mini",
                    indexText: "更新付款截至时间",
                    requestRemark:
                        "orderBatchCode:订单批次号,operTime:操作时间,",
                    requestContent:
                        '{"functionName": "UpdateOrderDetailExpireTime_Mini","orgCode": "0004","contentData": {"orderBatchCode":"0004202404090003153149","operTime":"2024-04-11 11:12:12"}}',
                    responeContent: "{code:编号 name 名称}",
                },
                {
                    index: "GetCurrentRoom_Mini",
                    indexText: "获取当前房台",
                    requestRemark:
                        "",
                    requestContent:
                        '{"functionName": "GetCurrentRoom_Mini","orgCode": "0004","contentData": ""}',
                    responeContent: "{currentRoomCode:编号 currentRoomName 名称}",
                },
                {
                    index: "MemberOpenNewCard_Mini",
                    indexText: "会员注册新卡",
                    requestRemark:
                        "carCode:新卡的类型(从会员信息中的未注册卡中获取)",
                    requestContent:
                        '{"functionName": "MemberOpenNewCard_Mini","orgCode": "0004","contentData": {"carCode":"003"}}',
                    responeContent: "",
                },
                {
                    index: "UpdateMemberLevel_Mini",
                    indexText: "会员卡升级",
                    requestRemark: `门店取登录的门店编码,cardNo:卡号`,
                    requestContent:
                        '{"functionName":"UpdateMemberLevel_Mini","orgCode": "0004","contentData":{"cardNo":"卡号"}}',
                    responeContent: ``,
                },
                {
                    index: "GetStoreSetting",
                    indexText: "获取品牌门店基础信息 AppId等",
                    requestRemark:
                        "orgCode: 机构编号",
                    requestContent: '{"orgCode": "0004"}',
                    responeContent: "获取品牌门店基础信息",
                },
                {
                    index: "GetCurrentRoomComsume_Mini",
                    indexText: "获取当前房台的消费单号",
                    requestRemark:
                        "roomCode: 房台编号",
                    requestContent: '{"functionName":"GetCurrentRoomComsume_Mini","orgCode": "0004","contentData":{"roomCode":"0004001"}}',
                    responeContent: "获取消费单号consumeCode",
                },
                {
                    index: "GetMemberCar_Mini",
                    indexText: "输入手机号获取会员卡列表",
                    requestRemark:
                        "mobile:手机号,no:卡号,carName:卡名称,memberCode:会员账号",
                    requestContent:
                        '{"functionName": "GetMemberCar_Mini","orgCode": "0004","contentData": {"mobile":""}}',
                    responeContent: "输入手机号获取会员卡列表",
                },
            ],
        };
    },
    methods: {
        optionChange() {
            let option = this.optionsInfo.find(
                (item) => item.index == this.requestIndex
            );
            this.requestRemark = option.requestRemark;
            this.requestContent = option.requestContent;
            this.requestResult = "";
            this.responeContent = option.responeContent;
        },
        copyToken() {
            this.requestContent = this.token;
        },
        async submit() {
            if (this.requestIndex == "CreateMember") {
                let url = `${config.API_URL}/CreateMember`;
                let data = JSON.parse(this.requestContent);
                let result = await http.post(url, data);
                if (result.opFlag == "1") {
                    this.hasToken = false;
                    this.requestResult = "会员卡号:" + result.opMsg;
                } else {
                    this.requestResult = result.opMsg;
                    this.hasToken = false;
                }
            } else if (this.requestIndex == "AppMemberLogin") {
                let url = `${config.API_URL}/AppMemberLogin`;
                let data = JSON.parse(this.requestContent);
                let result = await http.get(
                    url +
                    "?username=" +
                    data.username +
                    "&orgCode=" +
                    data.orgCode
                );
                if (result.opFlag == "1") {
                    this.token = this.requestResult = result.userInfo.token;
                    this.hasToken = true;
                    this.requestResult = "登录成功,token:" + this.token;
                } else {
                    this.requestResult = result.opMsg;
                    this.hasToken = false;
                }
            } else if (this.requestIndex == "WXLogin") {
                let url = `${config.API_URL}/WXLogin`;
                let data = JSON.parse(this.requestContent);
                let result = await http.get(url + "?code=" + data.code);
                console.log(result);
                if (result.opFlag == "1") {
                    if (result.data.loginstatus == 1) {
                        this.token = result.data.userInfo.token;
                        this.hasToken = true;
                        this.requestResult = "登录成功,token:" + this.token;
                    } else {
                        this.requestResult = result.opMsg;
                        this.hasToken = false;
                    }
                } else {
                    this.requestResult = result.opMsg;
                    this.hasToken = false;
                }
            } else if (this.requestIndex == "WXTelLogin") {
                let url = `${config.API_URL}/WXTelLogin`;
                let data = JSON.parse(this.requestContent);
                let result = await http.post(url, data);

                if (result.opFlag == "1") {
                    if (result.data.loginstatus == 1) {
                        this.token = result.data.userInfo.token;
                        this.hasToken = true;
                        this.requestResult = "登录成功,token:" + this.token;
                    } else {
                        this.requestResult = result.opMsg;
                        this.hasToken = false;
                    }
                } else {
                    this.requestResult = result.opMsg;
                    this.hasToken = false;
                }
            }
            else if (this.requestIndex == "GetQrCodeMini") {
                let url = `${config.API_URL}/GetQrCodeMini`;
                let data = JSON.parse(this.requestContent);
                let result = await http.get(url + "?link=" + data.link + "&roomCode=" + data.roomCode + "&orgCode=" + data.orgCode + "&version=" + data.version);
                console.log(result);
                if (result.opFlag == "1") {
                    this.requestResult = result.qrCodeUrl;
                } else {
                    this.requestResult = result.opMsg;
                    this.hasToken = false;
                }
            }
            else if (this.requestIndex == "api/Upload") {
                alert("文件上传,请到PostMan或者其他工具中请求");
            }
            else if (this.requestIndex == "GetStoreSetting") {
                let url = `${config.API_URL}/GetStoreSetting`;
                let data = JSON.parse(this.requestContent);
                let result = await http.get(url + "?orgCode=" + data.orgCode);
                console.log(result);
                if (result.opFlag == "1") {
                    this.requestResult = result.storeInfo;
                } else {
                    this.requestResult = result.opMsg;
                }
            }
            else {
                if (!this.hasToken) {
                    this.requestResult = "请登录";
                } else {
                    let url = `${config.API_URL}/MemberAppObjProcess`;
                    let data = JSON.parse(this.requestContent);
                    console.log(this.token);
                    let result = await http.post(url, data, {
                        headers: {
                            token: "Bearer " + this.token,
                        },
                    });
                    if (result.opFlag == "1") {
                        // eslint-disable-next-line no-debugger
                        // debugger
                        try {
                            this.requestResult = JSON.stringify(
                                JSON.parse(
                                    JSON.stringify(result.content)
                                        .replaceAll('\\"', '"')
                                        .replaceAll('"[', "[")
                                        .replaceAll(']"', "]")
                                )
                            );
                            this.responseResult = JSON.parse(this.requestResult)
                        } catch (error) {
                            this.requestResult =
                                result.content.objectList[0].rowData;
                        }
                    } else {
                        this.requestResult = result.opMsg;
                    }
                }
            }
        },
        format() {
            let result = JSON.parse(this.requestContent)
            this.requestContent = JSON.stringify(result, null, 4)
        }
    },
    async mounted() {
        this.optionChange();
    },
};
</script>
